package com.ease.util {

   /**
    * This interface defines the dynamic loading of classes give the class name.
    * Typically, a class definition can be found within the application context.
    * However, the class loader should capable of locating and loading classes
    * defined in disperate Modules.
    */
   public interface IClassLoader {
      /**
       * Instantiates an object of the given type.
       *
       * @param className
       *    Name of the class to be instantiated.
       *
       * @param callback
       *    The listener receiving the class instance. The callback should be
       *    an instance of type AsyncCallback.
       *    Example: callback = new AsyncCallback(onInstantiateSuccess, onInstantiateError)
       *    function onInstantiateSuccess(result:Object):void{...}
       *    function onInstantiateError(error:Error):void {...}
       *
       * @param loadInfo
       *    The loadInfo is the result of a getClassLoadInfo call.
       */
      function instantiate(className:String, callback:AsyncCallback, loadInfo:Object = null):void;

      /**
       * Given an instance object this function will return the loading
       * information (like pluginId, version, etc.,).  It returns null if
       * the object load info is not available and the type can be loaded
       * directly using flex library.
       *
       * @param instance The instance for which load info is requested.
       *
       * @return the class loading info (like pluginId, version, etc.,).
       */
      function getClassLoadInfo(instance:Object):Object;

   }

}